package com.example.zlpermissionservice.controller;

import com.example.zlpermissionservice.entity.Role;
import com.example.zlpermissionservice.mapper.RoleMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author zhenliu（孙凌岳）
 * @Description TODO
 * @Date 2025/6/14 19:56
 * @Version 1.0
 */
@RestController
@RequestMapping("/role")
@Slf4j
@Api(tags = "角色管理控制器")
public class RoleController {
    @Resource
    private RoleMapper RoleMapper;

    @PostMapping("/add")
    @ApiOperation(value = "新增角色", notes = "向数据库插入一个新的角色记录（用于测试）")
    public boolean addUser(@RequestBody Role role) {
        RoleMapper.insert(role);
        return true;
    }
}
